package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * Created by Administrator on 2016/6/14.
 */
public class WechatLoginAction extends AHttpService<PbBean.PbResUserWechatLogin> {

    private String openId;

    public static WechatLoginAction newInstance(Context context, String openId) {
        return new WechatLoginAction(context, openId);
    }

    private WechatLoginAction(Context context, String openId) {
        super(context);
        this.openId = openId;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqUserWechatLogin.Builder builder = PbBean.PbReqUserWechatLogin.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setThirdId(openId);

        return apiService.wechatLogin(builder.build());
    }
}
